﻿<UserControl x:Class="SterlingExample.Views.BuildView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ViewModel="clr-namespace:SterlingExample.ViewModel" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <Grid x:Name="LayoutRoot">
        <Grid.DataContext>
            <ViewModel:BuildViewModel/>
        </Grid.DataContext>
            <Grid.RowDefinitions>
                <RowDefinition Height="40"/>
                <RowDefinition/>
        </Grid.RowDefinitions>
            <TextBlock Text="Building the Database..." FontSize="15" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
        <StackPanel HorizontalAlignment="Center" Orientation="Vertical" Grid.Row="1">
            <TextBlock Foreground="White" Text="{Binding Step}" Margin="5" VerticalAlignment="Center"/>
            <Grid>
            <ProgressBar IsIndeterminate="{Binding StepType}" HorizontalAlignment="Center" 
                         Width="300"
                         Height="20" 
                         Margin="5" 
                         Minimum="0"
                         Maximum="100"
                         Value="{Binding ProgressPct}"
                         />
                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding Total}"/>
            </Grid>
            <TextBlock Foreground="White" HorizontalAlignment="Center" FontWeight="Bold" Text="Completed Tasks" Margin="0 20 0 0"/>
            <ItemsControl ItemsSource="{Binding TasksComplete}">
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical" HorizontalAlignment="Center">
                            <TextBlock Foreground="White" TextWrapping="Wrap" Margin="5" HorizontalAlignment="Center" Text="{Binding}"/>
                            <Rectangle Height="2" Width="100" Fill="White"/>
                        </StackPanel>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </StackPanel>
    </Grid>
    
</UserControl>
